﻿using Admin.CommonLib.Models.Role;
using Admin.CommonLib.Models.User;
using Swimj.CommonLib.Base;

namespace Admin.RazorLib.Services
{
    public interface IRoleService
    {
        Task<PaginatedResult<RoleInfoResponseDto>> QueryRolesByPage(RoleSearchRequestDto model);

        Task<Result<List<RoleInfoResponseDto>>> QueryRoles(RoleSearchRequestDto model);

        Task<Result<RoleInfoResponseDto>> CreateRole(RoleEditRequestDto model);

        Task<Result<RoleInfoResponseDto>> UpdateRole(Guid key, RoleEditRequestDto model);

        Task<Result<RoleInfoResponseDto>> GetRole(Guid key);

        Task<HttpResponseMessage> ExportRoles(RoleSearchRequestDto model);

        Task<HttpResponseMessage> ExportTemplate();

        Task<Result<IList<RoleClaimResponseDto>>> QueryPermissionsByRole(Guid id);

        Task<Result<IList<RoleClaimResponseDto>>> UpdatePermissionsByRole(Guid id, List<string> model);

        Task<PaginatedResult<UserInfoResponseDto>> QueryUsersByRole(Guid id, UserSearchRequestDto model);

        Task<Result<IList<UserInfoResponseDto>>> UpdateUsersByRole(Guid id, RoleOperateRequestDto model);

        Task<Result<IList<RoleImportResponseDto>>> ImportRoles(int importExcelRequestDto, string uploadFileName,
            Stream openReadStream);
    }
}